<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/jQuery_class_stu/jquery.js"></script>
<script type="text/javascript">
//jQuery를 이용
//each 함수 이용
$(document).ready(function(){
	$("input[name=allcheck]").on("click", function(){
		//$(셀렉터).prop("속성명", "속성값"); //선택된 객체의 속성을 변경
		$("input[name=menu]").prop("checked", this.checked);
		/*
		$("input[name=menu]").each(function(){
			this.checked = $("input[name=allcheck]").is(":checked");
		});
		*/
	});
});
//$(input[name=menu])
</script>
</head>
<body>
<h2>메뉴</h2>
<table>
	<tr>
		<td><input type="checkbox" name="menu" value="짜장면"></td>
		<td>짜장면</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="menu" value="짬뽕"></td>
		<td>짬뽕</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="menu" value="볶음밥"></td>
		<td>볶음밥</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="menu" value="탕수육"></td>
		<td>탕수육</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="menu" value="양장피"></td>
		<td>양장피</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="allcheck" ></td>
		<td>전체선택</td>
	</tr>
</table>
</body>
</html>
